/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaPrincipal.java
 *
 * Created on 26/05/2011, 23:35:45
 */

package gui;

/**
 *
 * @author Thiago
 */
public class TelaPrincipal extends javax.swing.JFrame {

    /** Creates new form TelaPrincipal */
    public TelaPrincipal() {
        initComponents();
        setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButton_Aloc = new javax.swing.JButton();
        jButton_Salas = new javax.swing.JButton();
        jButton_Eventos = new javax.swing.JButton();
        jButton_Sair = new javax.swing.JButton();
        jButton_Sobre = new javax.swing.JButton();
        jLabel_Opcao = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Alocação De Salas e Eventos");

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/telaprincipal_background.png"))); // NOI18N

        jButton_Aloc.setText("Gerenciador Alocação");
        jButton_Aloc.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_AlocMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_AlocMouseExited(evt);
            }
        });
        jButton_Aloc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_AlocActionPerformed(evt);
            }
        });

        jButton_Salas.setText("Gerenciador Salas");
        jButton_Salas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_SalasMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_SalasMouseExited(evt);
            }
        });
        jButton_Salas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SalasActionPerformed(evt);
            }
        });

        jButton_Eventos.setText("Gerenciador Eventos");
        jButton_Eventos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_EventosMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_EventosMouseExited(evt);
            }
        });
        jButton_Eventos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_EventosActionPerformed(evt);
            }
        });

        jButton_Sair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/exitIcon.png"))); // NOI18N
        jButton_Sair.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_SairMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_SairMouseExited(evt);
            }
        });
        jButton_Sair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SairActionPerformed(evt);
            }
        });

        jButton_Sobre.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/info2icon.png"))); // NOI18N
        jButton_Sobre.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_SobreMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_SobreMouseExited(evt);
            }
        });
        jButton_Sobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_SobreActionPerformed(evt);
            }
        });

        jLabel_Opcao.setText("                                      Escolha uma das opcoes");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton_Sobre)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton_Sair))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton_Aloc)
                        .addGap(33, 33, 33)
                        .addComponent(jButton_Salas)
                        .addGap(31, 31, 31)
                        .addComponent(jButton_Eventos)))
                .addContainerGap(32, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(178, Short.MAX_VALUE)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(103, 103, 103))
            .addGroup(layout.createSequentialGroup()
                .addGap(90, 90, 90)
                .addComponent(jLabel_Opcao, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(47, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton_Aloc, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Salas, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Eventos, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20)
                .addComponent(jLabel_Opcao)
                .addGap(9, 9, 9)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton_Sobre)
                    .addComponent(jButton_Sair))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_AlocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_AlocActionPerformed
        new GerenciadorAlocacao().setVisible(true);
        dispose();
    }//GEN-LAST:event_jButton_AlocActionPerformed

    private void jButton_SalasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SalasActionPerformed
        new GerenciadorSalas().setVisible(true);
        dispose();
    }//GEN-LAST:event_jButton_SalasActionPerformed

    private void jButton_EventosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_EventosActionPerformed
         new GerenciadorEventos().setVisible(true);
        dispose();
    }//GEN-LAST:event_jButton_EventosActionPerformed

    private void jButton_AlocMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_AlocMouseEntered
       jLabel_Opcao.setForeground(new java.awt.Color(0, 172, 0));
       jLabel_Opcao.setText(OPCAO_GERALOC);
    }//GEN-LAST:event_jButton_AlocMouseEntered

    private void jButton_AlocMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_AlocMouseExited
       jLabel_Opcao.setForeground(new java.awt.Color(0,0,0));
       jLabel_Opcao.setText(OPCAO_DEFAULT);
    }//GEN-LAST:event_jButton_AlocMouseExited

    private void jButton_SalasMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SalasMouseEntered
       jLabel_Opcao.setForeground(new java.awt.Color(0, 172, 0));
       jLabel_Opcao.setText(OPCAO_GERSALA);
    }//GEN-LAST:event_jButton_SalasMouseEntered

    private void jButton_SalasMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SalasMouseExited
       jLabel_Opcao.setForeground(new java.awt.Color(0,0,0));
       jLabel_Opcao.setText(OPCAO_DEFAULT);
    }//GEN-LAST:event_jButton_SalasMouseExited

    private void jButton_EventosMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_EventosMouseEntered
       jLabel_Opcao.setForeground(new java.awt.Color(0, 172, 0));
       jLabel_Opcao.setText(OPCAO_GEREVEN);
    }//GEN-LAST:event_jButton_EventosMouseEntered

    private void jButton_EventosMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_EventosMouseExited
       jLabel_Opcao.setForeground(new java.awt.Color(0,0,0));
       jLabel_Opcao.setText(OPCAO_DEFAULT);
    }//GEN-LAST:event_jButton_EventosMouseExited

    private void jButton_SobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SobreActionPerformed
        new Sobre().setVisible(true);
    }//GEN-LAST:event_jButton_SobreActionPerformed

    private void jButton_SairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_SairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jButton_SairActionPerformed

    private void jButton_SobreMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SobreMouseEntered
       jLabel_Opcao.setForeground(new java.awt.Color(0, 172, 0));
       jLabel_Opcao.setText(OPCAO_SOBRE);
    }//GEN-LAST:event_jButton_SobreMouseEntered

    private void jButton_SobreMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SobreMouseExited
       jLabel_Opcao.setForeground(new java.awt.Color(0,0,0));
       jLabel_Opcao.setText(OPCAO_DEFAULT);
    }//GEN-LAST:event_jButton_SobreMouseExited

    private void jButton_SairMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SairMouseEntered
       jLabel_Opcao.setForeground(new java.awt.Color(0, 172, 0));
       jLabel_Opcao.setText(OPCAO_SAIR);
    }//GEN-LAST:event_jButton_SairMouseEntered

    private void jButton_SairMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_SairMouseExited
       jLabel_Opcao.setForeground(new java.awt.Color(0,0,0));
       jLabel_Opcao.setText(OPCAO_DEFAULT);
    }//GEN-LAST:event_jButton_SairMouseExited

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TelaPrincipal().setVisible(true);
            }
        });
    }


    private String OPCAO_DEFAULT = "                                         Escolha uma das opcoes";
    private String OPCAO_GERALOC = "                     Clique aqui para alocação de salas e eventos";
    private String OPCAO_GEREVEN = "                                Clique aqui para manipular eventos";
    private String OPCAO_GERSALA = "                                    Clique aqui para manipular salas";
    private String OPCAO_SOBRE =   "                    Clique aqui para obter informações do projeto";
    private String OPCAO_SAIR =    "                                  Clique aqui para sair do programa";
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_Aloc;
    private javax.swing.JButton jButton_Eventos;
    private javax.swing.JButton jButton_Sair;
    private javax.swing.JButton jButton_Salas;
    private javax.swing.JButton jButton_Sobre;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel_Opcao;
    // End of variables declaration//GEN-END:variables

}
